/*
 * UIJPGImage.h
 */

#ifndef UIJPGIMAGE_H_
#define UIJPGIMAGE_H_

#include "UIImage.h"

/**
 * UI Component for rendering a PNG Image
 */
class UIJPGImage: public UIImage {
public:
  /**
   * Constructor (loads the image file as an OpenGL texture)
   * @param x x-coordinate of the image to render
   * @param y y-coordinate of the image to render
   * @param width width of the image as an UI Component
   * @param height height of the image as an UI Component
   * @param file image file to be rendered
   */
  UIJPGImage(float x, float y, float width, float height, std::string file);

  /**
   * Destructor
   */
  virtual ~UIJPGImage();

  /**
   * Loads the image file as an OpenGL texture
   * @param file the image file to be loaded
   */
  virtual bool load(std::string& file);

protected:
  /**
   * Initializes the SDL support for JPG image files
   */
  void initSDLImageJPGSupport();

  /**
   * Quits the SDL support for JPG image files
   */
  void quitSDLImageJPGSupport();
};

#endif /* UIJPGIMAGE_H_ */
